﻿using System;
using DataObject;
using DataObject.Category;

public partial class Controls_Common_TopSubNavigator : System.Web.UI.UserControl
{
    public int CategoryId { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            ListCategory();
    }

    private void ListCategory()
    {
        var categories = CategoryController.Category_GetByParentId((int)CategoryType.Product, CategoryId, Constants.ACTIVE);
        if (categories.Count > 0)
        {
            rptCategory.DataSource = categories;
            rptCategory.DataBind();
        }
    }
}